package com.maixy.studyonlineapi.redis.template;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * hash redis 模板
 * Created by jason on 17-3-25.
 */

@Component
public class HyperLogLogsRedisTemplate extends BaseRedisTemplate {


    @Resource(name = "redisTemplate")
    private RedisTemplate<String, String> redisTemplate;

    public void add(String key, String... values) {
        redisTemplate.opsForHyperLogLog().add(key, values);
    }

    public Long size(String key) {
        return redisTemplate.opsForHyperLogLog().size(key);
    }

}
